<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>Generic I2C EEPROM<br/>
<small>
[<a class="el" href="group__other.html">Other</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="eeprom_8h.html">eeprom.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>RobotC EEPROM Driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#ga0bb5af400d8883a7a9dc432ad3296546">EEPROM_I2C_ADDR</a>&#160;&#160;&#160;0xA0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#gaddfda15f5f3ec6f8f325f48be50c548a">EEPROM_PAGE_SIZE</a>&#160;&#160;&#160;128</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#ga273af6ee6caa116643c95dc7b3bc3101">EEPROMreadBytes</a> (tSensors link, long address, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;data, int numbytes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#gaf986171d64fa04da0955cd6558e749e4">EEPROMwriteBytes</a> (tSensors link, long address, <a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;data, int numbytes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#ga034513db62caab4f3785842540b30f1e">_EEPROMwriteDummy</a> (tSensors link, long address)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#gad970205e82294e04606e7a62b34749a3">EEPROM_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___e_e_p_r_o_m.html#ga3f227700949481751aec23a8be2a2acd">EEPROM_I2CReply</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Generic I2C EEPROM </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga0bb5af400d8883a7a9dc432ad3296546"></a><!-- doxytag: member="eeprom.h::EEPROM_I2C_ADDR" ref="ga0bb5af400d8883a7a9dc432ad3296546" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EEPROM_I2C_ADDR&#160;&#160;&#160;0xA0</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>EEPROM I2C device address </p>

<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00038">38</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaddfda15f5f3ec6f8f325f48be50c548a"></a><!-- doxytag: member="eeprom.h::EEPROM_PAGE_SIZE" ref="gaddfda15f5f3ec6f8f325f48be50c548a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define EEPROM_PAGE_SIZE&#160;&#160;&#160;128</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Page for the AT24C512 </p>

<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00041">41</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga034513db62caab4f3785842540b30f1e"></a><!-- doxytag: member="eeprom.h::_EEPROMwriteDummy" ref="ga034513db62caab4f3785842540b30f1e" args="(tSensors link, long address)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool _EEPROMwriteDummy </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Perform a dummy write to set address for next read</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the EEPROM </td></tr>
    <tr><td class="paramname">address</td><td>the address to set </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00087">87</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga273af6ee6caa116643c95dc7b3bc3101"></a><!-- doxytag: member="eeprom.h::EEPROMreadBytes" ref="ga273af6ee6caa116643c95dc7b3bc3101" args="(tSensors link, long address, tByteArray &amp;data, int numbytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool EEPROMreadBytes </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"> <em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;&#160;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>numbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read a number of bytes from address </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the EEPROM </td></tr>
    <tr><td class="paramname">address</td><td>the address to read from </td></tr>
    <tr><td class="paramname">data</td><td>the byte array to store read result in </td></tr>
    <tr><td class="paramname">numbytes</td><td>the number of bytes to read (limited to 16 at a time) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="eeprom-test1_8c-example.html#a2">eeprom-test1.c</a>, and <a class="el" href="eeprom-test2_8c-example.html#a2">eeprom-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00062">62</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf986171d64fa04da0955cd6558e749e4"></a><!-- doxytag: member="eeprom.h::EEPROMwriteBytes" ref="gaf986171d64fa04da0955cd6558e749e4" args="(tSensors link, long address, tByteArray &amp;data, int numbytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool EEPROMwriteBytes </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"> <em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> &amp;&#160;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>numbytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write a single byte to address </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the EEPROM </td></tr>
    <tr><td class="paramname">address</td><td>the address to write to </td></tr>
    <tr><td class="paramname">data</td><td>the byte array to write </td></tr>
    <tr><td class="paramname">numbytes</td><td>the number of bytes to write (limited to 13 at a time) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="eeprom-test1_8c-example.html#a1">eeprom-test1.c</a>, and <a class="el" href="eeprom-test2_8c-example.html#a1">eeprom-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00107">107</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga3f227700949481751aec23a8be2a2acd"></a><!-- doxytag: member="eeprom.h::EEPROM_I2CReply" ref="ga3f227700949481751aec23a8be2a2acd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group___e_e_p_r_o_m.html#ga3f227700949481751aec23a8be2a2acd">EEPROM_I2CReply</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C reply data </p>

<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00044">44</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad970205e82294e04606e7a62b34749a3"></a><!-- doxytag: member="eeprom.h::EEPROM_I2CRequest" ref="gad970205e82294e04606e7a62b34749a3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group___e_e_p_r_o_m.html#gad970205e82294e04606e7a62b34749a3">EEPROM_I2CRequest</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="eeprom_8h_source.html#l00043">43</a> of file <a class="el" href="eeprom_8h_source.html">eeprom.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
